<style type="text/css">
    .bjui-pageHeader{
        font-size: 18px;
        font-weight: bold;
    }
    .form{
        padding: 15px;
    }
    .form dl {
        overflow: hidden;
        padding-top: 15px;
    }

    .form dt {
        color: #666;
        float: left;
        font-size: 14px;
        padding: 3px 0 0;
        width: 11%;
    }
    .form dd {
        float: left;
        line-height: 22px;
    }
    dd.desc {
        height: 30px;
        padding: 0 10px;
        width: 150px;
    }
    .control-group{
        font-size: 14px;
        padding: 5px;
        line-height: 30px;
    }
</style>
<script type="text/javascript">
            $('#file_upload').uploadify({
                    'fileSizeLimit': '5000KB',
                    'buttonText': '上传图片建议尺寸：360像素 * 200像素',
                    'buttonClass': 'uploadify',
                    'swf': '__PUBLIC__/UI/plugins/uploadify/scripts/uploadify.swf',
                    'uploader': '{:U('Site/upload')}',
                    'width': '360',
                    'fileTypeDesc': 'Image Files',
                    'fileTypeExts': '*.gif; *.jpg; *.bmp; *.jpeg; *.png',
                    'multi': false,
                    'formData': {
                        'session_id': '<?php echo session_id();?>'
                    },
                    'onUploadSuccess': function(file, data, response) {
                        var msg = $.parseJSON(data);
                        $('#txtimage').attr("src", msg.path);
                        $("#picurl").val(msg.path);
                        $(".upload_preview").show();

                    }
                });
</script>
<div class="bjui-pageContent">
    <form action="<if condition="$action eq 'edit'">
        {:U('Wechat/atuwenEdit')}
        <else/>
        {:U('Wechat/atuwen')}
    </if>
    " method="post" data-toggle="validate">
    <div class="content">
        <div class="control-group">
            <label class="control-label">标题</label>
            <span class="maroon">*</span>
            <span class="help-inline">(必填,不能超过64个字)</span>
            <div class="controls">
                <input name="title" type="text" id="title" class="text" notnull="" style="width:450px;" value="{$tuwen.title}" data-rule="required" data-tip="请填写标题" data-ok="OK"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">关键字</label>
            <span class="maroon">*</span>
            <span class="help-inline">(必填,不能超过64个字)</span>
            <div class="controls">
                <input name="keywords" type="text" id="keywords" class="text" notnull="" style="width:450px;" value="{$tuwen.keywords}" data-rule="required" data-tip="请填写关键字" data-ok="OK"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">描述</label>
            <span class="maroon">*</span>
            <span class="help-inline">(必填,不能超过64个字)</span>
            <div class="controls">
                <input name="description" type="text" id="description" class="text" notnull="" style="width:450px;" value="{$tuwen.content}" data-rule="required" data-tip="请填写描述" data-ok="OK" />
            </div>
        </div>
        <div id="file_upload" class="uploadify" style="height: 30px; width: 360px;">

            <div id="file_upload-button" class="uploadify-button uploadify" style="height: 30px; line-height: 30px; width: 360px;">
                <span class="uploadify-button-text">上传图片建议尺寸：360像素 * 200像素</span>
            </div>
        </div>
        <div id="file_upload-queue" class="uploadify-queue"></div>
        <if condition="$action eq 'edit'">
            <p style="display: block;" class="js_cover upload_preview" id="upload_preview">
                <else/>
                <p style="display: none;" class="js_cover upload_preview" id="upload_preview"></if>
                <img style="background:#bababa;" id="txtimage" src="{$tuwen.picurl}" width="360" height="200"></p>

            <div style="clear:both;"></div>

            <div class="control-group">
                <label class="control-label">网址跳转</label>
                <span class="help-inline">(只提供手机版本的链接，请浏览器打开你的手机网站复制URL地址)</span>
                <div class="controls">
                    <input type="text" style="width:450px;" placeholder="http://" class="text" id="url" maxlength="500" name="url" value="{$tuwen.url}"  data-rule="required;url" data-tip="请填写网址" data-ok="OK"></div>
            </div>

            <div class="control-group">
            <label class="control-label">排序</label>
            <span class="maroon">*</span>
            <span class="help-inline">(整数)</span>
            <div class="controls">
                <input name="sort" type="text" id="sort" class="text" notnull="" style="width:450px;" value="{$tuwen.sort}" data-rule="required;digits" data-tip="请填写排序" data-ok="OK"/>
            </div>
        </div>

            <br/>
            <div class="control-group">
                <label class="control-label">是否设置为自动回复信息</label>
                <span class="help-inline">(图文回复信息自动调用最新8条图文信息作为回复)</span>
                <div class="controls">
                    <input type="radio" name="iszidong" value="0" id="iszidong" <if condition="$tuwen['iszidong'] eq 0">checked="checked"</if>
                >否
                <input type="radio" name="iszidong" value="1" id="iszidong" <if condition="$tuwen['iszidong'] eq 1">checked="checked"</if>
            >是
        </div>
    </div>

    <br/>
    <div class="control-group">
        <div class="controls">
            <input type="hidden" value="{$tuwen.picurl}" id="picurl" name="picurl" data-rule="required" data-tip="请上传图片">
            <if condition="$action eq 'edit'">
                <input type="hidden" name="id" value="{$tuwen.id}" id="id"></if>
         </div>
    </div>
</form>
</div>
</div>
<div class="bjui-pageFooter">
<ul>
    <li>
        <button type="button" class="btn-close" data-icon="close">关闭</button>
    </li>
    <li>
        <button data-icon="save" class="btn btn-default" type="submit">保存</button>
    </li>
</ul>
</div>